<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="css/style.css" rel="stylesheet" type="text/css"/>
<title>Listagem de Autores</title>
</head>
<body>
<div id="wrapper">
	<jsp:include page="menu.jsp">	
	   <jsp:param name="page" value="autor" />	
	</jsp:include>

	<div id="content">

		<h2>Listagem de Autores</h2>
		<br/>
		<table>
			<tr class="tableHeader">
				<td>CPF</td>
				<td>Nome</td>
				<td>Email</td>
				<td>Telefone</td>
			</tr>
			<c:forEach var="autor"  items="${autorList}" varStatus="status">
				<tr class="row<c:out value="${status.index%2}"/>">
					<td>
						<a href="autorAction.do?acao=edit&codigo=<c:out value="${autor.codigo}"/>"><c:out value="${autor.cpf}"/></a>
					</td>
					<td>
						<c:out value="${autor.nome}"/>
					</td>
					<td>
						<c:out value="${autor.email}"/>
					</td>
					<td>
						<c:out value="${autor.telefone}"/>
					</td>
				</tr>
			</c:forEach>
		</table>
		<br/>
		<html:submit styleClass="button" onclick="return onAdd()">Adicionar</html:submit>
	</div>
</div>
<script type="text/javascript">
function onAdd() {
	document.location='autorAction.do?acao=edit';
	return false;
}
</script>
</body>
</html>